package com.cangxuan.backend.service.impl;

import com.cangxuan.backend.dao.IArticleDao;
import com.cangxuan.backend.entity.Article;
import com.cangxuan.backend.service.IArticleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class ArticleServiceImpl implements IArticleService {

    IArticleDao articleDao;

    @Autowired
    public void setArticle(IArticleDao articleDao) {
        this.articleDao = articleDao;
    }
    @Override
    public List<Article> getTypeId(int id) {
        return articleDao.selectByArticleTypeId(id);
    }

    @Override
    public Article getID(int id) {
        return articleDao.selectByArticleId(id);
    }

    @Override
    public Article  getNewID(int id) {
        return articleDao.selectByArticleNewId(id);
    }
}
